package com.jx.smartbot.VO;

import com.fasterxml.jackson.annotation.JsonInclude;

@JsonInclude(JsonInclude.Include.NON_NULL)
public class Result<T> {
    public int errcode=0x0;
    public String errmsg="ok";
    public  String id=null;
    public T data=null;
    public Result() {}
    public Result(int code, String msg) {
        this.errcode = code;
        this.errmsg = msg;
    }

    public Result(T data) {
        this.errcode = 0x0;
        this.errmsg = "ok";
        this.data = data;
    }
    

    @Override
    public String toString() {
    	if(data==null){
    		  return "{" +
    	                "errcode=" + Integer.toHexString(errcode)  +
    	                ", errmsg='" + errmsg + '\'' +
    	                '}';
    	}
        return "{" +
                "errcode=" + Integer.toHexString(errcode)  +
                ", errmsg='" + errmsg + '\'' +
                ", data=" + data +
                '}';
    }
}
